package com.joney.website.dto.request;

import com.joney.common.utils.DateFormatType;
import com.joney.common.utils.DateUtil;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

@Setter
public class ConsumeQry {

    private Long uid;

    private String startDate;

    private String endDate;

    private String kinds;

    public String getStartDate() {
        if(StringUtils.isBlank(startDate)){
            startDate = DateUtil.formatDateToString(DateUtil.getFirstdayOfMonth(), DateFormatType.YYYY_MM_DD.getValue());
        }
        return startDate;
    }

    public String getEndDate() {
        if(StringUtils.isBlank(endDate)){
            endDate = DateUtil.formatDateToString(DateUtil.getLastdayOfMonth(), DateFormatType.YYYY_MM_DD.getValue());
        }
        return endDate;
    }

    public String getKinds() {
        if(StringUtils.isBlank(kinds)){
            kinds = null;
        }
        return kinds;
    }
}
